//
// Created by tjlhz on 2022/6/25.
//

#include "Student.h"
#include <iostream>
#include "GlobalData.h"


string CStudent::GetAllScore() {
    return "";
}

string CStudent::GetOneScore(string courseNo) {
    return "";
}

void CStudent::PrintMyInfo() {
    cout << this->mName << endl << this->mClass << endl;
}

void CStudent::DoFunction() {
    bool exit = false;
    while (true) {
        cout << "请选择功能" << endl;
        cout << "1.查询教学班级" << endl;
        cout << "2.加入教学班级" << endl;
        cout << "3.退出教学班级" << endl;
        cout << "4.查询本人成绩" << endl;
        cout << "其它.退出" << endl;
        int id;
        cin >> id;
        switch (id) {
            case 1:
                GetTeachClass();
                break;
            case 2:
                int teachClasId;
                cout << "请输入教学班级号";
                cin >> teachClasId;
                ChooseCourse(teachClasId);
                break;
            case 3:
                cout << "请输入教学班级号";
                cin >> teachClasId;
                CancelCourse(teachClasId);
                break;
            case 4:
                QueryScore();
                break;
            default:
                exit = true;
                break;
        }
        if (exit)
            break;
    }
}


void CStudent::ChooseCourse(int teachClassId) {
    GlobalData::teachClassManager.JoinClass(teachClassId, *this);
    cout << "ChooseCourse" << endl;

}

void CStudent::CancelCourse(int teachClassId) {
    cout << "CancelCourse" << endl;
}

void CStudent::QueryScore() {
    cout << "QueryScore" << endl;
}

void CStudent::GetTeachClass() {
    //TODO:
    cout << "GetTeachClass" << endl;
}
